using System;
using System.Collections.Generic;

namespace RPGLibrary.ItemClasses
{
    public enum Hands {One, Two}

    public enum ArmorLocation {Body, Head, Hands, Feet}

    public abstract class BaseItem
    {
        protected List<string> allowableClasses = new List<string>();

        public List<string> AllowableClasses
        {
            get { return allowableClasses; }
            protected set { allowableClasses = value; }
        }

        public string Type { get; protected set; }
        public string Name { get; protected set; }
        public int Price { get; protected set; }
        public float Weight { get; protected set; }
        public bool IsEquipped { get; protected set; }

        public BaseItem(string name, string type, int price, float weight, params string[] allowableClasses)
        {
            foreach (string t in allowableClasses)
                AllowableClasses.Add(t);

            Name = name;
            Type = type;
            Price = price;
            Weight = weight;
            IsEquipped = false;
        }

        public abstract object Clone();

        public virtual bool CanEquip(string characterstring)
        {
            return AllowableClasses.Contains(characterstring);
        }

        public override string ToString()
        {
            var itemString = "";
            itemString += Name + ", ";
            itemString += Type + ", ";
            itemString += Price + ", ";
            itemString += Weight;

            return itemString;
        }
    }
}